﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ADC.DAL;

namespace ADC.Web.Admin
{
    public partial class Admin : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           // var date = new DateTime(2013, 09, 13);
            //if (DateTime.Today > date)
            //{
            //    Response.Redirect("http://google.com.vn");
            //}
            if (Session["UserInfo"] == null)
            {
                Response.Redirect("Login.aspx", false);
            }
            try
            {
                var user = (User)Session["UserInfo"];
                lblName.Text = user.Name;
            }
            catch (Exception)
            {
                //TODO: Need to log here
            }
        }

        protected void LinkButtonLogout_Click(object sender, EventArgs e)
        {
            Session.Abandon();
            Response.Redirect("Login.aspx", false);
        }
    }
}